package com.zidongxiangxi.clock.http.exception;

import lombok.Getter;

/**
 * This is Description
 *
 * @author chenxudong
 * @date 2021/12/27
 */
@Getter
public class ClockException extends RuntimeException {
    private final Integer code;
    private final String message;

    public ClockException(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public static ClockException newInstance(ErrorCode errorCode) {
        return new ClockException(errorCode.getCode(), errorCode.getMessage());
    }
}
